notbook: Fix a bug in focus handling
authorMatthias Clasen <mclasen@redhat.com>
Wed, 8 Apr 2020 11:48:35 +0000 (07:48 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 9 Apr 2020 21:50:28 +0000 (17:50 -0400)
After the header widget was introduced, focus would get
stuck in a loop between actions and tabs.

This could be seen in the notebook on page 3 of
widget-factory.

gtk/gtknotebook.c

index 57f90c8338fe5e5d34c9d06033b8b186090328ee..d74e2defd387c007ce895cabdc94545b21f9314f 100644 (file)
@@ -3558,6 +3558,8 @@ gtk_notebook_focus (GtkWidget        *widget,
 
   widget_is_focus = gtk_widget_is_focus (widget);
   old_focus_child = gtk_widget_get_focus_child (widget);
+  if (old_focus_child)
+    old_focus_child = gtk_widget_get_focus_child (old_focus_child);
 
   effective_direction = get_effective_direction (notebook, direction);